<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
    <title>LISPBUILDER-SDL-IMAGE - </title>
    <style type="text/css">

      body {
      margin: 10px 20px 20px 220px;
      padding: 0px;
      font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
      font-size: small;
      text-align: justify;
      max-width: 50em;
      background-color: white;
      }

      a, a:visited {
      text-decoration: none;
      color: maroon;
      }

      /* index */

      div.index {
      position: fixed;
      top: 0px;
      left: 0px;
      width: 180px;
      height: 100%;
      margin: 0px;
      padding: 5px;
      font-size: 12px;
      background-color: #DCDCDC;
      border-right: thin black solid;
      }

      div.index ol {
      color: navy;
      margin: 0px;
      padding-left: 0px;
      }

      div.index ol li {
      list-style: none;
      }

      div.index ol li:before {
      display: marker;
      content: counter(heading1) ". ";
      counter-increment: heading1;
      }

      div.index ol ol {
      padding-left: 10px;
      font-size: 10px;
      list-style: none;
      counter-reset: heading2;
      }

      div.index ol ol li:before {
      display: marker;
      content: counter(heading1)"." counter(heading2)" ";
      counter-increment: heading2;
      }

      /* heading styles */

      body > h1 {
      margin-top: 0px;
      }

      h1 {
      margin-top: 40px;
      margin-bottom: 0px;
      color: #4682B4;
      }

      h1:before {
      display: marker;
      content: counter(chapter) ". ";
      counter-increment: chapter;
      counter-reset: section1;
      }

      h1 + p {
      margin-top: 5px;
      }

      h2 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h2:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "  ";
      counter-increment: section1;
      }

      h2 + p {
      margin-top: 0px;
      }

      h3 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h3:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "  ";
      counter-increment: section2;
      }

      h3 + p {
      margin-top: 0px;
      }

      h4 {
      margin-top: 20px;
      color: #000000;
      margin-bottom: 0px;
      }

      h4:before {
      display: marker;
      content: counter(chapter) "." counter(section1) "." counter(section2) "." counter(section3) "  ";
      counter-increment: section3;
      }

      h4 + p {
      margin-top: 0px;
      }

      /* generated content for images and tables */

      img:after {
      content: "[" counter(image) "] " attr(title);
      counter-increment: image;
      display: block;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      color: black;
      }

      table:after {
      content: "Table " counter(table) ": " attr(summary);
      counter-increment: table;
      display: table-caption;
      caption-side: bottom;
      font-size: 10px;
      font-weight: bold;
      margin-top: 5px;
      margin-bottom: 20px;
      white-space: nowrap;
      color: black;
      }

      /* code for examples, code and pathnames*/

      div.example table {
      color: black;
      }

      div.example, div.code, div.path, div.sequence {
      margin: 10px 0px;
      border: 1px black solid;
      padding: 10px;
      background-color: #F4F4F4;
      counter-reset: image;
      color: maroon;
      }

      div.example:before {
      content: "Example " counter(example);
      counter-increment: example;
      display: block;
      }

      div.example + p {
      margin-bottom: 0px;
      }

      div.code:before {
      content: "Code";
      }

      div.path:before {
      content: "Path";
      }

      div.sequence:before {
      content: "Sequence";
      }

      p.reference:before {
      display: marker;
      content: "[" counter(reference) "]";
      counter-increment: reference;
      font-weight: bold;
      margin-right: 5px;
      }

      div.code:before, div.example:before, div.path:before, div.sequence:before {
      font-weight: bold;
      font-size: 15px;
      margin-bottom: 20px;
      color: black;
      }

      pre {
      color: Green;
      margin: 0px;
      padding: 0px;
      }


      /* equation counter */

      e:after {
      content: "[" counter(equation) "]";
      counter-increment: equation;
      display: block;
      float: right;
      margin-right: 10px;
      }

      /* to prevent the CC image from being numbered */

      img[alt="Creative Commons License"] {
      display: inline;
      }

      img[alt="Creative Commons License"]:after {
      display: none;
      }

      div#cc {
      background-color: #DCDCDC;
      border: thin black solid;
      padding: 10px;
      font-size: 10px;
      }

      /* Table Design */
      /* http://www.duoh.com/csstutorials/csstables/ */
      #mytable {
      width: 700px;
      padding: 0;
      margin: 0;
      }

      caption {
      padding: 0 0 5px 0;
      width: 700px;
      font: italic 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      text-align: right;
      }

      th {
      font: bold 11px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #4f6b72;
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      border-top: 1px solid #C1DAD7;
      letter-spacing: 2px;
      text-transform: uppercase;
      text-align: left;
      padding: 6px 6px 6px 12px;
      background: #CAE8EA url(images/bg_header.jpg) no-repeat;
      }

      th.nobg {
      border-top: 0;
      border-left: 0;
      border-right: 1px solid #C1DAD7;
      background: none;
      }

      td {
      border-right: 1px solid #C1DAD7;
      border-bottom: 1px solid #C1DAD7;
      background: #fff;
      padding: 6px 6px 6px 12px;
      color: #4f6b72;
      }


      td.alt {
      background: #F5FAFA;
      color: #797268;
      }

      th.spec {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #fff url(images/bullet1.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      }

      th.specalt {
      border-left: 1px solid #C1DAD7;
      border-top: 0;
      background: #f5fafa url(images/bullet2.gif) no-repeat;
      font: bold 10px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
      color: #797268;
      }

    </style>
  </head>

  <!--
      (CC) 2003 Luke Crook. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.

      Maintained by the Common Lisp Application Builder project at www.lispbuilder.org

      The entire styleguide was copied wholesale from http://www.markschenk.com/cssexp/publication/article.xml

      (CC) 2003 Mark Schenk. Some Rights Reserved.
      http://creativecommons.org/licenses/by/1.0
      This page is licensed under a Creative Commons License.
    -->

  <BODY BGCOLOR=#FFFFFF >

    <h1><a name="top" class=none> LISPBUILDER-SDL-IMAGE - </a></h1>

    <blockquote>
      <br>&nbsp;</br><h2><a name=abstract class=abstract>Abstract</a></h2>

      <p>
	LISPBUILDER-SDL-IMAGE provides a Lisp wrapper for the
	<a href="http://www.libsdl.org/projects/SDL_image/">SDL_Image</a> library.
	LISPBUILDER-SDL-IMAGE has a dependency on the LISPBUILDER-SDL package.
	LISPBUILDER-SDL-IMAGE is distributed under the
	<a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
      </p>
      <p>
	LISPBUILDER-SDL-IMAGE supports the following image formats:
	TGA, BMP, PNM, PBM, PGM, PPM, XPM, XCF, PCX , GIF, JPG, TIF, LBM and PNG.
      </p>
      <p>
	<font color=red>Current Version:</font> The current version of LISPBUILDER-SDL-IMAGE is version <a href="#download">0.2</a>.
      </p>
<!--       <p> -->
<!-- 	<font color=red>Download shortcut:</font> <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip</a>. -->
<!--       </p> -->
    </blockquote>

    <br>&nbsp;</br><h2><a class=none name="packageover">Package Overview</a></h2>
    <p>
      LISPBUILDER-SDL-IMAGE supports the following image formats:
      TGA, BMP, PNM, PBM, PGM, PPM, XPM, XCF, PCX , GIF, JPG, TIF, LBM and PNG.
    </p>
    <p>
      LISPBUILDER-SDL-IMAGE will attempt to automatically load an image by using the
      <a href="http://en.wikipedia.org/wiki/Magic_number_(programming)#Magic_numbers_in_files">Magic Number</a>
      in the image file. For image formats that have no magic number such as targa (.TGA), the
      LISPBUILDER-SDL-IMAGE API allows the image type to be specified as a parameter.
    </p>
    <p>
      Functions and symbols exported from the LISPBUILDER-SDL-IMAGE package are
      accessible from the <code>LISPBUILDER-SDL-IMAGE:</code> prefix or the
      shorter form <code>SDL-IMAGE:</code> nickname.
    </p>

    <p>
      Note that additional libraries are required to load JPG, PNG and TIFF images:
    </p>
    <ul>
      <li>JPG support requires the JPEG library:</li>
      <ul>
	<li><a href="http://www.ijg.org/">http://www.ijg.org/</a></li>
      </ul>
      <li>PNG support requires the PNG library, and the ZLib library:</li>
      <ul>
	<li><a href="http://www.libpng.org/pub/png/libpng.html">http://www.libpng.org/pub/png/libpng.html</a>, and </li>
	<li><a href="http://www.gzip.org/zlib/">http://www.gzip.org/zlib/</a></li>
      </ul>
      <li>TIFF support requires the TIFF library:</li>
      <ul>
	<li><a href="ftp://ftp.sgi.com/graphics/tiff/">ftp://ftp.sgi.com/graphics/tiff/</a></li>
      </ul>
    </ul>

    <br>&nbsp;</br><h2><a class=none name="examplesimple">Simple Example</a></h2>
    <div class="example">
      <p>
	This example was created with the following code:
      </p>
      <p>
	<img src="alien.png" width="200" height="167" title="Alien Technology" alt="Alien Technology"/>
      </p>

      <pre>
  (sdl:with-init ()
    (sdl:window 320 240)
    (sdl:draw-surface (sdl-image:load-image "lisp.tga" :image-type :TGA :force t))
    (sdl:with-events ()
      (:quit-event () t)
      (:video-expose-event (sdl:update-display))))
      </pre>
    </div>


    <div class="index">
      <ol>
	<li><a href="#top">LISPBUILDER-SDL-IMAGE</a></li>
	<ol>
	  <li><a href="#abstract">Abstract</a></li>
	  <li><a href="#packageover">Package Overview</a></li>
	  <li><a href="#examplesimple">Simple Example</a></li>
	  <li><a href="#compatibility">Compatibility</a></li>
	  <li><a href="#download">Download</a></li>
	  <li><a href="#installation">Installation</a></li>
	  <li><a href="#usage">Usage</a></li>
	  <li><a href="#examples">Examples</a></li>
	  <li><a href="#dependency">Dependencies</a></li>
	  <li><a href="#license">License</a></li>
	  <li><a href="#dictionar">The LISPBUILDER-SDL-IMAGE dictionary</a></li>
	  <ol>
	          <li><a href="#image-p"><code>image-p</code></a>
	            <li><a href="#image-type-of"><code>image-type-of</code></a>
	            <li><a href="#load-and-convert-image"><code>load-and-convert-image</code></a>
	            <li><a href="#load-image"><code>load-image</code></a>

	    </li>
	  </ol>
	  <li><a href="#ack">Acknowledgements</a></li>
	</ol>
      </div>


      <br>&nbsp;</br><h2><a class=none name="compatibility">Compatibility</h2>
	<p>
	  The following table describes the status of the Lisp implementations that have been tested with
	  LISPBUILDER-SDL-IMAGE:
	</p>

	<table id="mytable" cellspacing="0" summary="Compatibility">
	  <tr>
	    <th><b>Lisp Implementation</b></th>
	    <th colspan="3"><b>LISPBUILDER-SDL-IMAGE Status</b></th>
	    <th><b>Comments</b></th>
	  </tr>
	  <tr>
	    <th colspan="1"></th>
	    <th><b>Win32</b></th>
	    <th><b>Linux</b></th>
	    <th><b>MacOS</b></th>
	    <th></th>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://clisp.cons.org/">CLISP v2.38</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://www.lispworks.com/">Lispworks v4.4.6 Personal</a>
	    </th>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#60c060">Working</td>
	    <td class="alt" bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.franz.com/">Allegro Express 8.0</a>
	    </th>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">Unknown</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="specalt" scope="row">
	      <a href="http://openmcl.clozure.com/">OpenMCL</a>
	    </th>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor=blue><font color="#FFFFFF">NA</font></td>
	    <td class="alt" bgcolor="#ff6060">Unknown</td>
	    <td></td>
	  </tr>
	  <tr>
	    <th class="spec" scope="row">
	      <a href="http://www.sbcl.org/">SBCL</a>
	    </th>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#60c060">Working</td>
	    <td bgcolor="#ff6060">No</td>
	    <td></td>
	  </tr>
	</table>


	<br>&nbsp;</br><h2><a class=none name="download">Download</a></h2>
	<ul>
	  <li><font color=red>Development:</font> Available via anonymous SVN at:
	    <pre>
	      svn co https://lispbuilder.svn.sourceforge.net/svnroot/lispbuilder lispbuilder
	    </pre>
	  </li>
	  <li>
	    <font color=red>Stable:</font> The latest stable versions are available from the
	    <a href="http://sourceforge.net/project/showfiles.php?group_id=159740">LISPBUILDER-SDL repository on SourceForge.</a>
	  </li>
	  <li>
	    <font color=red>The Edi Weitz 'Starter Pack' Version:</font> The stable version of Lispbuilder,
	    suitable for the installation of installation LISPBUILDER-SDL-IMAGE using the Lisp Starter Pack from Edi Weitz is can be downloaded from
	    <a href="http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip">http://www.balooga.com/lispbuilder/lispbuilder-sdl-image.zip</a>.
	  </li>
	</ul>

	<br>&nbsp;</br><h2><a class=none name="installation">Installation</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#installation">the LISPBUILDER documentation</a>
	  for installation instructions.
	</p>

	<br>&nbsp;</br><h2><a class=none name="usage">Using LISPBUILDER-SDL-IMAGE</a></h2>
	<p>See <a href="http://lispbuilder.sourceforge.net/index.html#usage">the LISPBUILDER documentation</a>
	  for Usage instructions.
	</p>

	<br>&nbsp;</br><h2><a class=none name="examples">Running Examples in LISPBUILDER-SDL-IMAGE-EXAMPLES</a></h2>
	<p>Enter the following at the REPL to load the examples in the
	  LISPBUILDER-SDL-IMAGE-EXAMPLES package:</p>
	<pre>
	  (asdf:operate 'asdf:load-op :lispbuilder-sdl-image-examples)
	</pre>
	<p>The following examples are contained in the package LISPBUILDER-SDL-IMAGE-EXAMPLES:
	</p>
	<ul>
	  <li>(SDL-IMAGE-EXAMPLES:IMAGE-EXAMPLE)</li>
	</ul>


	<br>&nbsp;</br><h2><a class=none name="dependency">Dependencies</a></h2>
	<p>LISPBUILDER-SDL-IMAGE has a dependency on LISPBUILDER-SDL.</p>


	<br>&nbsp;</br><h2><a class=none name="license">License</a></h2>
	<p>
	  LISPBUILDER-SDL-IMAGE is distributed under the
	  <a href="http://en.wikipedia.org/wiki/MIT_License">MIT-style license</a>.
	</p>



	<br>&nbsp;</br><h2><a class=none name="dictionar">The LISPBUILDER-SDL-IMAGE dictionary</a></h2>




<!-- Entry for IMAGE-P -->

<p><br>[Generic function]<br><a class=none name='image-p'><b>image-p</b> <i>source image-type</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns <code>T</code> if the source <code>SOURCE</code> contains an image of type <code>IMAGE-TYPE</code>. Returns <code>NIL</code> otherwise.  Attempts to detect the image type using the <EM>magic number</EM> contained in the image if one is available.  <code>NIL</code> is always returned for images of type <code>TGA</code> as a <code>TGA</code> image does not contain a <EM>magic number</EM>. </p><h5>Example </h5>
<pre><code>(RWOPS-P SOURCE :IMAGE-TYPE :BMP)
</code></pre>

</blockquote>

<!-- End of entry for IMAGE-P -->


<!-- Entry for IMAGE-P -->

<p><br>[Method]<br><a class=none><b>image-p</b> <i>(source string) image-type</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns <code>T</code> if the image in the file at location <code>SOURCE</code> is of type <code>IMAGE-TYPE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>.  </li>
<li><code>IMAGE-TYPE</code> can be one of <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>.  </li>
</ul><h5>Examples </h5>
<pre><code>(IMAGE-P &amp;quot;image.bmp&amp;quot; :IMAGE-TYPE :BMP)
</code></pre>

</blockquote>

<!-- End of entry for IMAGE-P -->


<!-- Entry for IMAGE-P -->

<p><br>[Method]<br><a class=none><b>image-p</b> <i>(source rwops) image-type</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns <code>T</code> when the type of image contained in the <code>SDL:RWOPS</code> in the source <code>SOURCE</code> is of the type <code>IMAGE-TYPE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
<li><code>IMAGE-TYPE</code> must be one of <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>. </li>
</ul>

</blockquote>

<!-- End of entry for IMAGE-P -->


<!-- Entry for IMAGE-TYPE-OF -->

<p><br>[Generic function]<br><a class=none name='image-type-of'><b>image-type-of</b> <i>source</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the type of image in source <code>SOURCE</code>.  Attempts to detect the image type using the <EM>magic number</EM> contained in the image if one is available.  </p><h5>Returns </h5>
<ul><li>Returns the image type of <code>SOURCE</code> which may be one of  <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>, if the image type can be determined.  Returns <code>NIL</code> if the image cannot be determined (The <EM>magic number</EM> is not supported or the <EM>magic number</EM> is not found).  <code>NIL</code> is always returned for images of type <code>TGA</code> as a <code>TGA</code> image does not contain a <EM>magic number</EM>.  </li>
</ul>

</blockquote>

<!-- End of entry for IMAGE-TYPE-OF -->


<!-- Entry for IMAGE-TYPE-OF -->

<p><br>[Method]<br><a class=none><b>image-type-of</b> <i>(source string)</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the type of image in the file at location <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>.  </li>
</ul><h5>Example </h5>
<pre><code>(IMAGE-TYPE-OF &amp;quot;image.bmp&amp;quot;)
</code></pre>

</blockquote>

<!-- End of entry for IMAGE-TYPE-OF -->


<!-- Entry for IMAGE-TYPE-OF -->

<p><br>[Method]<br><a class=none><b>image-type-of</b> <i>(source rwops)</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Returns the type of image contained in the <code>SDL:RWOPS</code> in the source <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
</ul><h5>Example </h5>
<pre><code>(IMAGE-TYPE-OF SOURCE)
</code></pre>

</blockquote>

<!-- End of entry for IMAGE-TYPE-OF -->


<!-- Entry for LOAD-AND-CONVERT-IMAGE -->

<p><br>[Function]<br><a class=none name='load-and-convert-image'><b>load-and-convert-image</b> <i>source <tt>&amp;rest</tt> named-pairs <tt>&amp;key</tt> image-type force <tt>&amp;allow-other-keys</tt></i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Loads an image from the filename <code>SOURCE</code> as per <a href="#load-image-*">LOAD-IMAGE-*</a>,   converts this image to the current display format using <code>SDL:CONVERT-SURFACE</code>.  </p><p>Parameters supported are the same as those for <a href="#load-image">LOAD-IMAGE</a> and <code>SDL:CONVERT-IMAGE</code>.  </p>

</blockquote>

<!-- End of entry for LOAD-AND-CONVERT-IMAGE -->


<!-- Entry for LOAD-IMAGE -->

<p><br>[Generic function]<br><a class=none name='load-image'><b>load-image</b> <i>source <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates and returns a new surface from the source <code>SOURCE</code>. </p><p>Unless <code>:FORCE T</code>, the <EM>magic number</EM> will be used to determine the image type contained in the <code>SDL:RWOPS</code> in <code>SOURCE</code>.  To load an image when the <EM>magic number</EM> is unavailable (image formats such as <code>TGA</code> do not contain a <EM>magic number</EM><code>),  specify the image type using the </code>KEY<code>word </code>IMAGE-TYPE<code>. If the *magic number* is available  and does not match </code>IMAGE-TYPE<code>, then </code>IMAGE-TYPE<code> is ignored.  To load an image as </code>IMAGE-TYPE<code> when the *magic number* is available (effectively ignoring the *magic number*),  specify </code>:FORCE T<code>. It is probably best to avoid using </code>:FORCE T` unless you know what you are doing. </p><h5>Returns </h5>
<ul><li>Returns a new <code>SDL:SURFACE</code>, or <code>NIL</code> if <code>SOURCE</code> does not contain a valid image or the image type cannot be determined.   All non-magicable image formats, such as <code>TGA</code>, must be specified using <code>iMAGE-TYPE</code>.  To load a TGA image, for example, use <code>:IMAGE-TYPE :TGA</code></li>
</ul><h5>Example </h5>
<ul><li>To load a <code>BMP</code> image using the <EM>magic number</EM></li>
(CREATE-IMAGE-FROM-RWOPS SOURCE)
<li>To load a <code>TGA</code> image </li>
(CREATE-IMAGE-FROM-RWOPS SOURCE :IMAGE-TYPE :TGA)
<li>To load a <code>BMP</code> image as <code>TGA</code></li>
(CREATE-IMAGE-FROM-RWOPS SOURCE :IMAGE-TYPE :TGA :FORCE T)
</ul>

</blockquote>

<!-- End of entry for LOAD-IMAGE -->


<!-- Entry for LOAD-IMAGE -->

<p><br>[Method]<br><a class=none><b>load-image</b> <i>(source string) <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates and returns a new surface from the image in the file at the location <code>SOURCE</code>.  </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is the filename and path of the file on the drive of type <code>STRING</code>.  </li>
<li><code>IMAGE-TYPE</code> when specified type may be one of <code>NIL</code>, <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TGA</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>.  </li>
<li><code>FORCE</code> when <code>T</code> will force an image to be loaded as <code>IMAGE-TYPE</code>, ignoring any <EM>magic number</EM> when present in <code>SOURCE</code>.  </li>
<li><code>FREE</code> is only used when <code>SOURCE</code> is <code>SDL:RWOPS</code>. </li>
</ul><h5>Example </h5>
<ul><li>To load a <code>BMP</code> image using the <EM>magic number</EM></li>
(LOAD-IMAGE &amp;quot;image.bmp&amp;quot;)

(LOAD-IMAGE &amp;quot;image.tga&amp;quot; :IMAGE-TYPE :TGA)

(LOAD-IMAGE &amp;quot;image.bmp&amp;quot; :IMAGE-TYPE :BMP :FORCE T)
</ul>

</blockquote>

<!-- End of entry for LOAD-IMAGE -->


<!-- Entry for LOAD-IMAGE -->

<p><br>[Method]<br><a class=none><b>load-image</b> <i>(source rwops) <tt>&amp;key</tt> image-type force free</i> =&gt; <i>result</i></a>
<blockquote><br>

<p>Creates and returns a new surface from the image contained in the <code>SDL:RWOPS</code> structure in the source <code>SOURCE</code>. </p><h5>Parameters </h5>
<ul><li><code>SOURCE</code> is of type <code>SDL:RWOPS</code>. </li>
<li><code>IMAGE-TYPE</code> when specified type may be one of <code>NIL</code>, <code>:BMP</code>, <code>:GIF</code>, <code>:JPG</code>, <code>:LBM</code>, <code>:PCX</code>, <code>:PNG</code>, <code>:PNM</code>, <code>:TGA</code>, <code>:TIF</code>, <code>:XCF</code>, <code>:XPM</code> or <code>:XV</code>.  </li>
<li><code>FORCE</code> when <code>T</code> will force an image to be loaded as <code>IMAGE-TYPE</code>, ignoring any <EM>magic number</EM> when present in <code>SOURCE</code>.  </li>
<li><code>FREE</code> when <code>T</code> will automatically free the <code>SDL:RWOPS</code> in <code>SOURCE</code>. </li>
</ul>

</blockquote>

<!-- End of entry for LOAD-IMAGE -->
<br>&nbsp;<br><h3><a class=none name="ack">Acknowledgements</a></h3>

<ul>
  <li>
    Documentation prepared using Edi Weitz's
    <a href="http://weitz.de/documentation-template/">DOCUMENTATION-TEMPLATE</a>.
  </li>
</ul>

<p>
  <a href="index.html">BACK</a>
</p>

</body>
</html>
